<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>Android白盒静态检测</title>
  <link rel="stylesheet" href="/static/css/layui.css">
</head>
<body>
<fieldset class="layui-elem-field site-demo-button" style="margin-top: 5px;">
        <legend>病毒分析模块</legend>
<form class="layui-form" action="apk_security_check" method="POST" style="margin-top:10px;">
  <div class="layui-form-item">
    <label class="layui-form-label">任务名称</label>
    <div class="layui-input-inline" >
        <input type="text" name="assert_name" required  lay-verify="required" placeholder="请输入任务名称" autocomplete="off" class="layui-input"></input>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">恶意文件上传</label>
    <div class="layui-input-block" style="padding-top:0px;">
        <button type="button" class="layui-btn" id="test3"><i class="layui-icon"></i>上传文件</button>
        <font color="red">&nbsp;&nbsp;{{warming}}</font>
    </div>
      <div class="layui-form-mid layui-word-aux"><font color="red"></font></div>
  </div>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">任务描述</label>
    <div class="layui-input-block">
      <textarea name="assert_desc" placeholder="请输入内容" class="layui-textarea"></textarea>
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
      <!--<button class="layui-btn" lay-submit lay-filter="formDemo">开始扫描</button>-->
      <input type="submit" class="layui-btn" value="开始检测">
    </div>
  </div>
  <div class="layui-form-item layui-form-text">
    <div class="layui-input-block">
      <p><font color="red">{{data}}</font></p>
    </div>
  </div>
</form>
</fieldset>
<br>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
<script src="static/layui.js"></script>
<script>
layui.use('form', function(){
  var form = layui.form;

  //监听提交
  form.on('submit(formDemo)', function(data){
    layer.msg(JSON.stringify(data.field));
    return false;
  });
});
</script>
<script>
layui.use('upload', function(){
  var $ = layui.jquery
  ,upload = layui.upload;
  //指定允许上传的文件类型
  upload.render({
    elem: '#test3'
    ,url: 'upload'
    ,accept: 'file' //普通文件
    ,done: function(res){
      console.log(res)
    }
  });
});
</script>
<script>
//Demo
layui.use('form', function(){
  var form = layui.form;

  //监听提交
  form.on('submit(formDemo)', function(data){
    layer.msg(JSON.stringify(data.field));
    return false;
  });
});
</script>
<script>
layui.use('element', function(){
  var $ = layui.jquery
  ,element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块

  //触发事件
  var active = {
    tabChange: function(){
      //切换到指定Tab项
      element.tabChange('demo', '22'); //切换到：用户管理
    }
  };

  $('.site-demo-active').on('click', function(){
    var othis = $(this), type = othis.data('type');
    active[type] ? active[type].call(this, othis) : '';
  });

  //Hash地址的定位
  var layid = location.hash.replace(/^#test=/, '');
  element.tabChange('test', layid);

  element.on('tab(test)', function(elem){
    location.hash = 'test='+ $(this).attr('lay-id');
  });

});
</script>
<script>
layui.use('element', function(){
  var $ = layui.jquery
  ,element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块

  //触发事件
  var active = {
    setPercent: function(){
      //设置50%进度
      element.progress('demo', '50%')
    }
    ,loading: function(othis){
      var DISABLED = 'layui-btn-disabled';
      if(othis.hasClass(DISABLED)) return;

      //模拟loading
      var n = 0, timer = setInterval(function(){
        n = n + Math.random()*10|0;
        if(n>100){
          n = 100;
          clearInterval(timer);
          othis.removeClass(DISABLED);
        }
        element.progress('demo', n+'%');
      }, 300+Math.random()*1000);

      othis.addClass(DISABLED);
    }
  };

  $('.site-demo-active').on('click', function(){
    var othis = $(this), type = $(this).data('type');
    active[type] ? active[type].call(this, othis) : '';
  });
});
</script>
</body>
</html>